<?php include './application/views/common/zhs_header.php';?>

<!-- center部分 -->
<?php include './application/views/common/zhs_login.php';?>
<div class="inv_boxbb w">

  <div class="inv_lb">
  	<form id="bform" action="" method="get">
	    <ul>
	      <li>
	      	  <h3>标的类型：</h3>
		      <a <?php if($postArr['sftype'] == 0){?>  class="acc" <?php }?>  href="javascript:void(0);" onclick="setFtype(0);">不限</a>
		       <?php foreach ($borrow_type as $fk=>$fv){?>
         	 	<a  <?php if ($postArr['sftype']==$fk){?>  class="acc" <?php }?> href="javascript:void(0);" onclick="setFtype(<?php echo $fk;?>);"><?php echo $fv;?></a>
        	 	<?php }?>       
	      </li>
	      <li>
	     	 <h3>理财周期：</h3>
				<a <?php if($postArr['slimit'] == 0){?>  class="acc" <?php }?>  href="javascript:void(0);" onclick="setLimit(0);">不限</a>
		       <?php foreach ($borrow_time_limit_query as $lk=>$lv){?>
         	 	<a  <?php if ($postArr['slimit']==$lk){?>  class="acc" <?php }?> href="javascript:void(0);" onclick="setLimit(<?php echo $lk;?>);"><?php echo $lv;?></a>
        	 	<?php }?>       
	      </li>
	      <li>
	      		<h3>理财金额：</h3>
	      		<a <?php if($postArr['saccount'] == 0){?>  class="acc" <?php }?>  href="javascript:void(0);" onclick="setAccount(0);">不限</a>
		       <?php foreach ($borrow_account as $ak=>$av){?>
         	 	<a  <?php if ($postArr['saccount']==$ak){?>  class="acc" <?php }?> href="javascript:void(0);" onclick="setAccount(<?php echo $ak;?>);"><?php echo $av;?></a>
        	 	<?php }?>  
	      	</li>
	      <li>
	      		<h3>还款方式：</h3>
	      		<a <?php if($postArr['style'] == 0){?>  class="acc" <?php }?>  href="javascript:void(0);" onclick="setStyle(0);">不限</a>
		       <?php foreach ($borrow_style as $sk=>$sv){?>
         	 	<a  <?php if ($postArr['style']==$sk){?>  class="acc" <?php }?> href="javascript:void(0);" onclick="setStyle(<?php echo $sk;?>);"><?php echo $sv;?></a>
        	 	<?php }?>  
	      </li>
	    </ul>
	    <input type="hidden" id="sftype" name="sftype" value="<?php echo $postArr['sftype'];?>">
		<input type="hidden" id="slimit" name="slimit" value="<?php echo $postArr['slimit'];?>">
		<input type="hidden" id="saccount" name="saccount" value="<?php echo $postArr['saccount'];?>">
		<input type="hidden" id="style" name="style" value="<?php echo $postArr['style'];?>">
    </form>
    <script>
		function setFtype(v){
			document.getElementById('sftype').value=v;
			document.getElementById('bform').submit();
		}
		function setAccount(v){
			document.getElementById('saccount').value=v;
			document.getElementById('bform').submit();
		}
		function setStyle(v){
			document.getElementById('style').value=v;
			document.getElementById('bform').submit();
		}
		function setLimit(v){
			document.getElementById('slimit').value=v;
			document.getElementById('bform').submit();
		}
</script>
    
  </div>
  
  
  
  <div class="inv_bdd">
    <table>
      <thead>
        <tr>
          <th width="18%" height="38px">标题</th>
          <!-- 
          <th width="11%">信用等级</th>
           -->
          <th width="12%">年利率</th>
          <th width="12%">金额(元)</th>
          <th width="12%">理财周期</th>
          <th width="13%">还款方式</th>
          <th width="12%">理财进度</th>
          <th width="8%">操作&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
        </tr>
      </thead>
      <tbody>
  		<?php 
		foreach ($borrow_list as $borrow){
		?>
        <tr>
          	<td height="44px">
        	     <a href="/borrow/zhs_obj/<?php echo $borrow['id'];?>" class="cnxq_a<?php echo $borrow['ftype'];?>"><?php echo CON_NAME;?></a>
               <a href="/borrow/zhs_obj/<?php echo $borrow['id'];?>">-<?php echo $borrow_type[$borrow['ftype']].$borrow['id'].$borrow['title'];?></a>
         	 </td>
            <!-- 
            	<td width="11%"><img title="<?php echo $borrow_fsafe[$borrow['fsafe']][0];?>" alt="<?php echo $borrow_fsafe[$borrow['fsafe']][0];?>" src="<?php echo $borrow_fsafe[$borrow['fsafe']][1];?>"></td>
             -->
            <td width="12%"><?php echo $borrow['apr'];?>% <?php if($borrow['award']=='1'){ echo "+ {$borrow['funds']}%";}?></td>
            <td width="12%"><?php echo $borrow['account'];?></td>
            <td width="12%"><?php if($borrow['is_day'] == '1') echo "<span>".$borrow['time_limit_day']."</span> 天"; else echo "<span>".$borrow['time_limit']."</span> 月"; ?></td>
             <td width="13%"><?php echo $borrow_style[$borrow['style']];?></td>
            <td width="12%">
            	<div class="pb-container"> 
	                <div class="pb-value" style="width:<?php echo round($borrow['account_yes']/$borrow['account']*100);?>%"></div>
	             </div>
      				<h4><?php echo round($borrow['account_yes']/$borrow['account']*100);?>%</h4>
      			</td>
            <td>
            
            <?php
              if($borrow['fstatus']==3&&$borrow['repayment_account']>$borrow['repayment_yesaccount']){?>
            	<a href="/borrow/zhs_obj/<?php echo $borrow['id']?>" class="rztp_btn_hk">还款中</a>
            <?php }elseif($borrow['fstatus']==3&&$borrow['repayment_account']==$borrow['repayment_yesaccount']) { ?>
            	<a href="/borrow/zhs_obj/<?php echo $borrow['id']?>" class="rztp_btn_hk">已回款</a>
            <?php }elseif($borrow['fstatus']==1&&$borrow['account']==$borrow['account_yes']){ ?>
            	<a href="/borrow/zhs_obj/<?php echo $borrow['id']?>" class="rztp_btn">满标待审</a>
            <?php }else{?>
            	<a href="/borrow/zhs_obj/<?php echo $borrow['id']?>" class="rztp_btn">投标</a>
            	<?php } ?>
            </td>
          </tr>
         <?php 
		}
		?> 
      </tbody>
    </table>
    <?php echo $borrow['account']?>||<?php echo $borrow['account_yes']?>
    <div class="jxq_tcb">
      <h3>收益计算器 <a title="关闭" class="close"></a></h3>
      <ul class="jxq_cont">
        <li><span>投资金额：</span><input type="text" id="account" onblur="Calculate()">元</li>
        <li><span>年化收益：</span><input type="text" id="apr" readonly></li>
        <li><span>计息时长：</span><input type="text" id="time_limit" readonly></li>
        <li><span>预计收益：</span><input type="text" id="money" value = "0.00" size="8" readonly>元</li>
        <li><a href="javascript:;" id="tzi"><img src="/static/zhsjr/images/in_14.gif"></a></li>
      </ul>
 	  </div>

  </div>
  <div class="invbd_page"><?php echo $this->pagination->create_links();?></div>
</div> 


<?php include './application/views/common/zhs_footer.php';?>

<?php include './application/views/common/zhs_right.php';?>
